console.log("ajax链接")
var host = `http://47.96.224.206:8080/CandyFirst/`
// url_banner = "http://cnady.natapp1.cc/CandyFirst_war_exploded/first/showImage"
// url_topic="http://cnady.natapp1.cc/CandyFirst_war_exploded/first/firstTopic"
url_banner = host+ "first/showImage"
url_topic= host+"first/firstTopic"

"轮播图接口"
axios.get(url_banner).then((res) => {
	console.log(res)
	console.log(res.data[0].bannerImg)
	for (var i = 0; i < res.data.length; i++) {
		banner.innerHTML += `
						<img src="${res.data[i].bannerImg}" >
					`
	}
})

"话题接口"
axios.get(url_topic).then(res=>{
	console.log(res)
	console.log(res.data[0])
	for (var i = 0; i < res.data.length; i++) {
		sec.innerHTML += `
		<article class="art">
			<figcaption class="top"><img  src="${res.data[i].headUrl}" alt="66">
				${res.data[i].name}
			</figcaption>
			<figure onclick="javascript:location.href='../more/develop123.html'">
				<h3>
					<b>来自话题</b>
					${res.data[i].title}
				</h3>
				<div id="art_pic${i}">
					<p>${res.data[i].content}</p>
					<span>全文</span>
				</div>
			</figure>
			<span class="iconfont icon-dianzan">${res.data[i].dianzan}</span>
			<span class="iconfont icon-xiaoxi">${res.data[i].comment}</span>
			<span class="iconfont icon-wujiaoxing">${2199}</span>
			<span class="iconfont icon-fenxiang"></span>
		</article>
		`
		
		eval("var pp=art_pic"+i)
		ppArr=res.data[i].topicImages//获取一共多少图片
		for (var j = 0; j < ppArr.length; j++) {
			pp.innerHTML+=`
				<div class="img_bg" style="background-image: url(${ppArr[j].topicImage});"></div>
			`
			
		}
		
	}
})
